﻿* Encoding: UTF-8.

* STUDY 1 
*EFA of the dataset bfidatatemp1.sav

DATASET ACTIVATE DataSet1.
FACTOR
  /VARIABLES bfi_e1 bfi_e2 bfi_e3 bfi_e4 bfi_e5 bfi_e6 bfi_e7 bfi_e8
  /MISSING LISTWISE 
  /ANALYSIS bfi_e1 bfi_e2 bfi_e3 bfi_e4 bfi_e5 bfi_e6 bfi_e7 bfi_e8
  /PRINT UNIVARIATE INITIAL KMO EXTRACTION ROTATION
  /PLOT EIGEN
  /CRITERIA MINEIGEN(1) ITERATE(25)
  /EXTRACTION PAF
  /CRITERIA ITERATE(25)
  /ROTATION PROMAX(4)
  /METHOD=CORRELATION.
*CFA of the dataset bfidatatemp2.sav
*Run AMOS file twofactor.amw 
*Run AMOS file onefactor.amw
*Reliability analysis of bfidata.sav
DATASET ACTIVATE DataSet2.
RELIABILITY
  /VARIABLES=bfi_e2 bfi_e5 bfi_e7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.
RELIABILITY
  /VARIABLES=bfi_e1 bfi_e3 bfi_e4 bfi_e6 bfi_e8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.
RELIABILITY
  /VARIABLES=bfi_e1 bfi_e2 bfi_e3 bfi_e4 bfi_e5 bfi_e6 bfi_e7 bfi_e8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

*Run R Syntax file OmegaStudy1
*Ambivert Analyses  for bfidatat.sav

COMPUTE extpos=bfi_e1 + bfi_e3 + bfi_e4 + bfi_e6 + bfi_e8.
EXECUTE.
COMPUTE extneg=bfi_e2 + bfi_e5 + bfi_e7.
EXECUTE.
FREQUENCIES VARIABLES=extpos extneg
  /STATISTICS=MEDIAN
  /ORDER=ANALYSIS.
RECODE extpos (0 thru 22=0) (23 thru 100=1) INTO posmed.
EXECUTE.
RECODE extneg (0 thru 9=0) (10 thru 100=1) INTO negmed.
EXECUTE.
COMPUTE newvar=0.
IF (posmed = 1 & negmed = 1) newvar = 1.
IF (posmed = 1 & negmed = 0) newvar = 3.
IF (posmed = 0 & negmed = 1) newvar = 4.
IF (posmed = 0 & negmed = 0) newvar = 2. 
EXECUTE.
FREQUENCIES VARIABLES=newvar
  /ORDER=ANALYSIS.
ONEWAY age BY newvar
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS.
CROSSTABS
  /TABLES=sex BY newvar
  /FORMAT=AVALUE TABLES
  /CELLS=COUNT ROW COLUMN 
  /COUNT ROUND CELL.
ONEWAY cons neuro BY newvar
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS
  /POSTHOC=TUKEY ALPHA(0.05).

*STUDY 2 
*Reliability Analysis for IPIP2539-1.sav

DATASET ACTIVATE DataSet3.
RELIABILITY
  /VARIABLES=h1336 h1 h1110 h334 h29 x78 x83 h16 x112 h34
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.
RELIABILITY
  /VARIABLES=x56 h154 h1039 x68 h661 h592 h909 h1146 h589 h976
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

*Omega Syntax for Study 2 in OmegaStudy2.docx
*AMOS see  twofactortheone.amw and twofactortheoneone.amw

*Median split for IPIP2539-1.sav

COMPUTE extra=h34 + x112 + h16 + x83 + x78 + h29 + h334 + h1110 + h1 + h1366.
EXECUTE.

COMPUTE intra=x56 + h154 + h1039 + x68 + h661 + h592 + h909 + h1146 + h589 + h976.
EXECUTE.

FREQUENCIES VARIABLES=extra intra
  /STATISTICS=MEDIAN
  /ORDER=ANALYSIS.

RECODE extra (0 thru 33=0) (34 thru 100=1) INTO extt.
EXECUTE.
RECODE intra (0 thru 29=0) (30 thru 100=1) INTO intt.
EXECUTE.

COMPUTE newvar=0.
IF (extt = 1 & intt = 1) newvar = 1.
IF (extt = 1 & intt = 0) newvar = 2.
IF (extt = 0 & intt = 1) newvar = 3.
IF (extt = 0 & intt = 0) newvar = 4. 
EXECUTE.

DATASET ACTIVATE DataSet4.
FREQUENCIES VARIABLES=newvar
  /ORDER=ANALYSIS.

*ANOVAs for Big FIVE IPIP2539-1.sav

ONEWAY agree conscient emotstab openness BY newvar
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS
  /POSTHOC=TUKEY ALPHA(0.05).

*ANOVAs for self-monitoring, self-deception, other deception, self-esteem private self-conscious public self-concious 
*PAS_scale1.sav

DATASET ACTIVATE DataSet7.
USE ALL.
COMPUTE filter_$=(newvar ne 0).
VARIABLE LABELS filter_$ 'newvar ne 0 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

ONEWAY self_mon bidr_sde bidr_imm rslf_est priv_sc pub_sc BY newvar
  /MISSING ANALYSIS.

*ANOVA for Narcissim Psychopathy OPAS.sav

DATASET ACTIVATE DataSet2.
COMPUTE narcissism=truth2 + truth5 + truth6 +  truth9 + truth11 + truth14 + truth16 + truth19 + 
    truth21 + truth24 + truth26 + truth29 + truth31 + truth34 + truth36 + truth39 + truth41 + truth44 + 
    truth46 + truth49 + truth51 + truth54 + truth56 + truth59 + truth61 + truth64 + truth66 + truth68 + 
    truth70 + truth73 + truth75 + truth77 + truth79 + truth82 + truth84 + truth87 + truth89 + truth92 + 
    truth94 + truth97.
EXECUTE.

DATASET ACTIVATE DataSet6.
COMPUTE psychopathy=truth1 + truth3 + truth4 + truth7 + truth8 + truth10 + truth12 + truth13 + 
    truth15 + truth17 + truth18 + truth20 + truth22 + truth23 + truth25 + truth27 + truth28 + truth30 + 
    truth32 + truth33 + truth35 + truth37 + truth38 + truth40 + truth42 + truth43 + truth45 + truth47 + 
    truth48 + truth50 + truth52 + truth53 + truth55 + truth57 + truth58 + truth60 + truth62 + truth63 + 
    truth65 + truth67 + truth69 + truth71 + truth72 + truth74 + truth76 + truth78 + truth80 + truth81 + 
    truth83 + truth85 + truth86 + truth88 + truth90 + truth91 + truth93 + truth95 + truth96 + truth98.
EXECUTE.

ONEWAY narcissism BY newvar
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS
  /POSTHOC=TUKEY ALPHA(0.05).

ONEWAY psychopath BY newvar
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS
  /POSTHOC=TUKEY ALPHA(0.05).

*ANOVA for Alexithymia PEA_scales

DATASET ACTIVATE DataSet3.
ONEWAY tas BY newvar
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS
  /POSTHOC=TUKEY ALPHA(0.05).

*STUDY 3
*PersonalityClean_5.sav
*Scoring BFI IPIP

DATASET ACTIVATE DataSet1.
RECODE BFI_2 BFI_5 BFI_7 (1=5) (2=4) (3=3) (4=2) (5=1).
EXECUTE.

RECODE IPIP_5 IPIP_7 IPIP_8 IPIP_9 IPIP_10 IPIP_11 IPIP_12 IPIP_14 IPIP_16 IPIP_17 (1=5) (2=4) 
    (3=3) (4=2) (5=1).
EXECUTE.

COMPUTE bfiint=BFI_2+BFI_5+BFI_7.
EXECUTE.

COMPUTE bfiext=BFI_1+BFI_3+BFI_4+BFI_6+BFI_8.
EXECUTE.

COMPUTE ipipint=IPIP_5+IPIP_7+IPIP_8+IPIP_9+IPIP_10+IPIP_11+IPIP_12+IPIP_14+IPIP_16+IPIP_17.
EXECUTE.

COMPUTE ipipext=IPIP_1+IPIP_2+IPIP_3+IPIP_4+IPIP_6+IPIP_13+IPIP_15+IPIP_18+IPIP_19+IPIP_20.
EXECUTE.

RECODE bfiint (0 thru 7=0) (8 thru 100=1) INTO bfiintrecode.
EXECUTE.

RECODE bfiext (0 thru 18=0) (19 thru 100=1) INTO bfiextrecode.
EXECUTE.

RECODE ipipint (0 thru 25=0) (26 thru 100=1) INTO ipipintrecode.
EXECUTE.

RECODE ipipext (0 thru 36=0) (37 thru 100=1) INTO ipipextrecode.
EXECUTE.

compute newbfi = 0.
if (bfiintrecode=0 & bfiextrecode=0) newbfi=1.
if (bfiintrecode=0 & bfiextrecode=1) newbfi=2.
if (bfiintrecode=1 & bfiextrecode=0) newbfi=3.
if (bfiintrecode=1 & bfiextrecode=1) newbfi=4. 

compute newipip = 0.
if (ipipintrecode=0 & ipipextrecode=0) newipip=1.
if (ipipintrecode=0 & ipipextrecode=1) newipip=2.
if (ipipintrecode=1 & ipipextrecode=0) newipip=3.
if (ipipintrecode=1 & ipipextrecode=1) newipip=4.

FREQUENCIES VARIABLES=newbfi newipip
  /ORDER=ANALYSIS.

CROSSTABS
  /TABLES=newbfi BY newipip
  /FORMAT=AVALUE TABLES
  /STATISTICS=KAPPA 
  /CELLS=COUNT
  /COUNT ROUND CELL.

*Demographics

DATASET ACTIVATE DataSet8.
FREQUENCIES VARIABLES=Sex
  /ORDER=ANALYSIS.

DESCRIPTIVES VARIABLES=Age
  /STATISTICS=MEAN STDDEV MIN MAX.

FREQUENCIES VARIABLES=Ethnicity
  /ORDER=ANALYSIS.

*Reliability

RELIABILITY
  /VARIABLES=BFI_1 BFI_2 BFI_3 BFI_4 BFI_5 BFI_6 BFI_7 BFI_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

RELIABILITY
  /VARIABLES=IPIP_1 IPIP_2 IPIP_3 IPIP_4 IPIP_5 IPIP_6 IPIP_7 IPIP_8 IPIP_9 IPIP_10 IPIP_11 IPIP_12 
    IPIP_13 IPIP_14 IPIP_15 IPIP_16 IPIP_17 IPIP_18 IPIP_19 IPIP_20
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

RELIABILITY
  /VARIABLES=CogFlex_1 CogFlex_2 CogFlex_3 CogFlex_4 CogFlex_5 CogFlex_6 CogFlex_7 CogFlex_8 
    CogFlex_9 CogFlex_10 CogFlex_11 CogFlex_12
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

RELIABILITY
  /VARIABLES=Sit_Flex_1 Sit_Flex_2 Sit_Flex_3 Sit_Flex_4 Sit_Flex_5 Sit_Flex_6 Sit_Flex_7 
    Sit_Flex_8 Sit_Flex_9 Sit_Flex_10 Sit_Flex_11 Sit_Flex_12 Sit_Flex_13 Sit_Flex_14 Sit_Flex_15 
    Sit_Flex_16
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

RELIABILITY
  /VARIABLES=BFI_1 BFI_3 BFI_4 BFI_6 BFI_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

RELIABILITY
  /VARIABLES=BFI_2 BFI_5 BFI_7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

RELIABILITY
  /VARIABLES=IPIP_1 IPIP_2 IPIP_3 IPIP_4 IPIP_6 IPIP_13 IPIP_15 IPIP_18 IPIP_19 IPIP_20
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

RELIABILITY
  /VARIABLES=IPIP_5 IPIP_7 IPIP_8 IPIP_9 IPIP_10 IPIP_11 IPIP_12 IPIP_14 IPIP_16 IPIP_17
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA
  /STATISTICS=DESCRIPTIVE SCALE
  /SUMMARY=TOTAL.

*AMOS BFI bfianalysis.amw 
*AMOS IPIP ipipanalysis/amw

* ANOVAs BFI IIPI by Cognitive Flexibility and Situational Flexibility PersonalityClean_5.sav

COMPUTE cogflextot=CogFlex_1 + CogFlex_2 + CogFlex_3 + CogFlex_4 + CogFlex_5 + CogFlex_6 + 
    CogFlex_7 + CogFlex_8 + CogFlex_9 + CogFlex_10 + CogFlex_11 + CogFlex_12.
EXECUTE.

COMPUTE Sitiflextot=Sit_Flex_1 + Sit_Flex_2 + Sit_Flex_3 + Sit_Flex_4 + Sit_Flex_5 + Sit_Flex_6 + 
    Sit_Flex_7 + Sit_Flex_8 + Sit_Flex_9 + Sit_Flex_10 + Sit_Flex_11 + Sit_Flex_12 + Sit_Flex_13 + 
    Sit_Flex_14 + Sit_Flex_15 + Sit_Flex_16.
EXECUTE.

CORRELATIONS
  /VARIABLES=cogflextot Sitflextot
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.

ONEWAY cogflextot Sitflextot BY newbfi
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS
  /POSTHOC=TUKEY ALPHA(0.05).

ONEWAY cogflextot Sitflextot BY newipip
  /STATISTICS DESCRIPTIVES 
  /MISSING ANALYSIS
  /POSTHOC=TUKEY ALPHA(0.05).





